#pragma once

#include "ddraw.h"

#define DVR_MONITOR_COUNT 4
typedef struct _tagScreenMon
{
	GUID                 guid;
	HMONITOR             hMonitor;
	LPDIRECTDRAW7        pDD;
	LPDIRECTDRAWSURFACE7 pDDSFront;
	LPDIRECTDRAWSURFACE7 pDDSOverlay;
	_tagScreenMon()
	{
		memset(this,0,sizeof(_tagScreenMon));
	}
}ScreenMon;


class DDrawPrimary
{
public:
	DDrawPrimary(void);
	~DDrawPrimary(void);

public:
	void EnumMonitor();

public:
	int InitPrimary(HWND hWnd);
	void UnInitPrimary();

private:
	static BOOL CALLBACK _DDEnumCallback(GUID FAR * pGUID, LPSTR pName, LPSTR pDescription,  LPVOID pUserData, HMONITOR hMonitor);
	BOOL DDEnumCallback(GUID FAR * pGUID, LPSTR pName, LPSTR pDescription, HMONITOR hMonitor);

public:
	int       m_nScreenCount;
	ScreenMon m_xScreenMon[DVR_MONITOR_COUNT];

public:
	TGCriticalSection m_Sect;

private:
	BOOL m_bInit;
	
};

extern DDrawPrimary g_xDDrawPrimary;
